<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <th:block th:include="include :: header('人员不良行为记录编辑')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <link href="../static/css/workboard.css" th:href="@{/css/workboard.css}" rel="stylesheet"/>
</head>
<style>
.tdContent{
	position:relative
}
input.error, select.error {
    background-color: #fbe2e2;
    border-color: #c66161;
    color: #c00;
}
label.error {
    position: absolute;
    right: 48px;
    top: 8px;
    color: #ef392b;
    font-size: 12px;
}
.icheckbox-blue.checked.disabled {
	background-position: -40px 0;
}
</style>
<body>
    <div class="container-div">
        <div class="tabsbody ">
            <div class="tabsbody-item active">
                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
                    <tbody>
                        <tr>
                            <td>
                                <div class="page-title">
                                    <span>人员不良行为记录</span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <form id="formsubmit">
                                    <table cellpadding="0" cellspacing="0" class="tbEidt"
                                        style="width: 100%;word-break:break-all;background-color: #ffffff;">
                                        <tbody>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px">不良行为代码<font color="red">*
                                                    </font>
                                                </td>
                                                <td class="tdContent" style="text-align: left;">
                                                	<input type="hidden" name="IGMIntegrityApplyInfoGuid" style="width:90%;" readonly="readonly"  th:value="${applyInfo}==null or ${applyInfo.Guid}==null ? ' ':${applyInfo.Guid}">
                                                	<input type="hidden" name="Guid" style="width:90%;" readonly="readonly"  th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.Guid}==null ? ' ':${personnalPoorInfoEntity.Guid}">
                                                    <input type="text" id="BehaviorCode" name="BehaviorCode" style="width:90%;" readonly="readonly" th:value="${StandardEntity}==null or ${StandardEntity.BehaviorCode}==null ? ' ':${StandardEntity.BehaviorCode}">
                                                    <span id="btnBehavior" class="OpenWin" shiro:hasPermission="integrityInformationAdd:personBadBehavior:selectlist" onclick="addpeopleBehavior('选择人员不良行为信用评分标准','人员不良行为')"></span>
                                                </td>
                                                <td class="tdTitle">不良行为类别</td>
                                                <td class="tdContent">
                                                	<input type="text" readonly="readonly" name="BehaviorCategory" style="width:100%;border:0;outline:none;" th:value="${StandardEntity}==null or ${StandardEntity.BehaviorCategory}==null ? ' ':${StandardEntity.BehaviorCategory}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="width: 18%;">不良行为描述</td>
                                                <td class="tdContent" colspan="3">
                                                	<textarea name="BehaviorDescription" readonly="readonly" rows="3" cols="20"
                                                        style="width:100%;border:0;outline:none;" th:text="${StandardEntity}==null or ${StandardEntity.BehavioDescription}==null ? ' ':${StandardEntity.BehavioDescription}"></textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle">扣分分值<font color="red">*</font>
                                                </td>
                                                <td class="tdContent" id="Score">
                                                	<input type="text" readonly="readonly" name="PenaltyScores" style="width:100%;border:0;outline:none;color:red">
                                                </td>
                                                <td class="tdContent" colspan="2">有效期内扣除分数上限：
                                                    <input type="text" readonly="readonly" name="MaxScores" style="width:20%;border:0;outline:none;color:red" th:value="${StandardEntity}==null or ${StandardEntity.MaxScores}==null ? ' ':${StandardEntity.MaxScores}">
                                                    	已扣分数：
                                                    <input type="text" readonly="readonly" name="PointsDeducted" style="width:20%;border:0;outline:none;color:red" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PointsDeducted}==null ? ' ':${personnalPoorInfoEntity.PointsDeducted}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px; width: 18%;">姓名
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" style="width: 32%; text-align: left;">
                                                    <input name="PersonName" id="PersonName" type="text" maxlength="100" style="width:90%;" readonly="readonly" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PersonName}==null ? ' ':${personnalPoorInfoEntity.PersonName}">
                                                    <input name="PersonGuid" type="hidden" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PersonGuid}==null ? ' ':${personnalPoorInfoEntity.PersonGuid}">
                                                </td>
                                                <td class="tdTitle" style="width: 18%;">
									                                                    证件类型<font color="red">*</font>
                                                </td>
                                                <td class="tdContent" style="width: 32%">
                                                	<input type="text" readonly="readonly" name="CertType" style="width:30%;border:0;outline:none;color:red" th:value="${personnalPoorInfoEntity.CertType}">
                                                </td>
                                            </tr>
                                             <tr>
                                            	<td class="tdTitle" style="height: 32px; width: 18%;">证件号码
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" style="width: 32%; text-align: left;" colspan="3">
                                                    <input name="CertNumber" id="CertNumber" type="text" maxlength="100" style="width:34.5%;" readonly="readonly" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.CertNumber}==null ? ' ':${personnalPoorInfoEntity.CertNumber}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px; width: 18%;">所在企业
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" style="width: 32%; text-align: left;">
                                                    <input name="CompanyName" id="CompanyName" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.CompanyName}==null ? ' ':${personnalPoorInfoEntity.CompanyName}" type="text" maxlength="100" style="width:90%;" readonly="readonly">
                                                    <input name="CompanyGuid" type="hidden" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.CompanyGuid}==null ? ' ':${personnalPoorInfoEntity.CompanyGuid}">
                                                </td>
                                                <td class="tdTitle" style="width: 18%;">
									                                                    组织机构代码/&nbsp;<br>
									                                                    统一社会信用代码<font color="red">*</font>
                                                </td>
                                                <td class="tdContent" style="width: 32%">
                                                    <input name="OrganCode" id="OrganCode" type="text" class="txtSingleBox"
                                                      readonly="readonly"  style="width:100%;" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.OrganCode}==null ? ' ':${personnalPoorInfoEntity.OrganCode}">
                                                </td>
                                            </tr>
                                            <tr>
                                            	<td class="tdTitle" style="width: 18%;">
									                                                    工程名称<font color="red">*</font>
                                                </td>
                                                <td class="tdContent"  style="width: 32%" colspan="3">
                                                	<input name="ProjectName" id="ProjectName" type="text" maxlength="100" style="width:34.5%;" readonly="readonly" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.ProjectName}==null ? ' ':${personnalPoorInfoEntity.ProjectName}">
                                                	<input name="ProjectGuid" type="hidden" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.ProjectGuid}==null ? ' ':${personnalPoorInfoEntity.ProjectGuid}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px;">发生地所在市县
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <input name="PublishArea" type="text" readonly="readonly" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PublishArea}==null ? ' ':${personnalPoorInfoEntity.PublishArea}" maxlength="100"
                                                        class="txtSingleBox" style="width:100%;">
                                                </td>
                                                <td class="tdTitle">所属区</td>
                                                <td class="tdContent" name="Area" readonly="readonly" style="width: 32%" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.Area}==null ? ' ':${personnalPoorInfoEntity.Area}"></td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px">处罚（处理）机构级别
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                	<input type="text" readonly="readonly" name="InLevel" style="width:20%;border:0;outline:none;color:red" th:value="${personnalPoorInfoEntity.InLevel}">
                                                </td>
                                                <td class="tdTitle">处罚(处理)机构<font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <input name="PunishmentDept" type="text" readonly="readonly" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PunishmentDept}==null ? ' ':${personnalPoorInfoEntity.PunishmentDept}"
                                                        style="width:100%;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px;">处罚(处理)决定文号
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <input name="PunishmentDecideCode" type="text" readonly="readonly" style="width:100%;" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PunishmentDecideCode}==null ? ' ':${personnalPoorInfoEntity.PunishmentDecideCode}">
                                                </td>
                                                <td class="tdTitle">处罚(处理)日期<font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <div class="input-group date">
                                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                                        	<input type="text" name="PunishmentDate" readonly="readonly" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PunishmentDate}==null ? ' ':${personnalPoorInfoEntity.PunishmentDate}"  autocomplete="off">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 50px;">处罚(处理)决定内容
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" colspan="3">
                                                    <textarea name="PunishmentDecideContent" rows="3" cols="20"
                                                      readonly="readonly"  style="width:100%;" th:text="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.PunishmentDecideContent}==null ? ' ':${personnalPoorInfoEntity.PunishmentDecideContent}"></textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px;">登记人</td>
                                                <td class="tdContent">
                                                    <input id="RegisterName" readonly="readonly" style="width:80%;border:0;outline:none;" name="RegisterName" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.RegisterName}==null ? ' ':${personnalPoorInfoEntity.RegisterName}">
                                                    <input type="hidden" name="LoginId" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.LoginId}==null ? ' ':${personnalPoorInfoEntity.LoginId}">
                                                </td>
                                                <td class="tdTitle">登记部门</td>
                                                <td class="tdContent">
                                                    <input id="RegisterDept" readonly="readonly" style="width:80%;border:0;outline:none;" name="RegisterDept" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.RegisterDept}==null ? ' ':${personnalPoorInfoEntity.RegisterDept}">
                                                    <input type="hidden" name="RegisterDeptGuid" th:value="${personnalPoorInfoEntity}==null or ${personnalPoorInfoEntity.RegisterDeptGuid}==null ? ' ':${personnalPoorInfoEntity.RegisterDeptGuid}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px">不良行为分类
                                                </td>
                                                <td class="tdContent" colspan="3" id="checkBoxs">
                                                    <label  class="check-box"  for="CheckBoxList1_0">
														<input name="role" type="checkbox" id="CheckBoxList1_0" value="行政处罚">行政处罚
													</label>
													<label  class="check-box"  for="CheckBoxList1_1">
														<input name="role" type="checkbox" id="CheckBoxList1_1" value="行政处理">行政处理
													</label>
													<label  class="check-box"  for="CheckBoxList1_2">
														<input name="role" type="checkbox" id="CheckBoxList1_2" value="通报">通报
													</label>
													<label  class="check-box"  for="CheckBoxList1_3">
														<input name="role" type="checkbox" id="CheckBoxList1_3" value="其他">其他
													</label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" align="center" style="width: 18%; height: 32px">
                                                    <span id="labMaterials">相关材料</span>
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" colspan="3" align="left">
                                                    <div class="form-group" style="margin-bottom: 6px;margin-top: 6px;">
                                                    	<input type="hidden" name="Materials">
                                                    	<p class="iconfile" style="padding:4px;display:none">
                                                    		<span>
                                                    		  <i class="glyphicon glyphicon-file"></i>
                                                    		</span>
                                                    		<input name="FileNameOld" readonly="readonly" style="width:60%;border:0;outline:none;" class="hasPath" th:value="${FileNameOld}">
                                                    		<a th:if="${fileState == '1'}" class="btn btn-success btn-xs" th:onclick="openUrl([[${filePath}]],[[${personnalPoorInfoEntity.FileNameOld}]])"><i class="fa fa-edit"></i>下载</a>
                                                    		<a th:if="${fileState == '0'}" class="btn btn-success btn-xs" rel="noopener noreferrer" th:href="${filePath}" target="_blank"><i class="fa fa-edit"></i>下载</a>
                                                    	</p>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 50px;">撤销理由</td>
                                                <td class="tdContent" colspan="3">
                                                    <textarea name="UndoReason" id="UndoReason" rows="3" cols="20"
                                                        style="width:100%;" required></textarea>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="row">
		        <div class="col-sm-offset-5 col-sm-10" style="margin-top:10px">
		            <button type="button" class="btn btn-sm btn-primary" onclick="approveReport(this)"><i class="fa fa-check"></i>保存</button>&nbsp;
		            <button type="button" class="btn btn-sm btn-primary" onclick="approveReport(this)"><i class="fa fa-check"></i>保存并上报</button>&nbsp;
		            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		        </div>
		    </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
    	var prefix = ctx+"integrityInformationAdd/peopleBehavior";
    	/* 隐藏域  */
    	var behaviorCode = $('input[name="BehaviorCode"]').val();
    	var personGuid = $('input[name ="PersonGuid"]').val();
    	var idcard = $('input[name ="CertNumber"]').val();
    	
    	/* 下载  */
    	function openUrl(filePath, FileNameOld){
    		window.location.href = ctx + 'integrityInformationAdd/peopleBehavior/download?resource='+filePath+'&fileName='+ encodeURI(FileNameOld);
    	}
    	
	     /*编辑回显分数   */
	    if($.isArray([[${subStr}]])){
 				for(var i = 0; i < [[${subStr}]].length; i++){
 					if([[${subStr}]][i] == [[${personnalPoorInfoEntity.PenaltyScores}]]){
 						$('input[name="PenaltyScores"]').val([[${personnalPoorInfoEntity.PenaltyScores}]]);
 						break;
 					}
 				}
 			}else{
 				$('input[name="PenaltyScores"]').val([[${personnalPoorInfoEntity.PenaltyScores}]]);
 		};
 		/*编辑分类 */
 		var checkboxs = [[${personnalPoorInfoEntity.BadBehaviorType}]].split(',');
 		if($.isArray(checkboxs)){
 			var checkType = $.grep(checkboxs, function(n) {return $.trim(n).length > 0;})
 			var checkTypes = $('input[name="role"]');
 			for(var i =0;i<checkTypes.length;i++){
 				for(var n = 0;n<checkType.length;n++){
 					checkTypes[i].disabled = true;
 					if(checkTypes[i].value === checkType[n]){
 						checkTypes[i].checked = true;
 					}
 				}
 			}
 		}
    	/*判断是否有文件路径 && 文件路径 赋值隐藏域   */
    	if($.common.isNotEmpty([[${personnalPoorInfoEntity.Materials}]])){
    		$('input[name="Materials"]').val([[${personnalPoorInfoEntity.Materials}]]);
    		//$('input[name="FileNameOld"]')
    		$('.iconfile').show();
    	}else{
    		$('.iconfile').remove();
    	}
        /* 保存并上报 */
        function approveReport(dom) {
        	if($("#formsubmit").validate().element($("#UndoReason"))){
	    		var contend = $(dom).text();
	        	var formData = $("#formsubmit").serializeArray();
	       		if(contend == "保存"){
	        		formData.push({"name": "SaveOrReport", "value": "保存"});
	        	}else if(contend == "保存并上报"){
	        		formData.push({"name": "SaveOrReport", "value": "保存并上报"});
	        	}
	       		$.operate.saveTab(prefix + "/peopleBadBehaviorUndoSaveAndReport", formData);
	    	}
	  		}
    </script>
</body>

</html>